# Create your views here.
from django.shortcuts import get_object_or_404, render_to_response
from srn.models import disciplini
from srn.models import models

def root(request):
    object_list = disciplini.objects.order_by('-nazvanie')[:15]
    return render_to_response('srn/disciplini_list.html',
                              {'object_list': object_list})

def index(request):
    object_list = disciplini.objects.order_by('-id')[:10]
    return render_to_response('srn/disciplini_list.html',
                              {'object_list': object_list})

def detail(request, object_id):
    p = get_object_or_404(disciplini, pk=object_id)
    return render_to_response('srn/disciplini_detail.html',
                              {'q': p})
							  
def all(request):
	models_list = models
	return render_to_response('srn/all.html',
							{'models_list': models_list})